package org.tale.bootbase;

import com.alibaba.nacos.api.annotation.NacosInjected;
import com.alibaba.nacos.api.naming.NamingService;
import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
@NacosPropertySource(dataId = "example", autoRefreshed = true)
public class BootBaseApplication {

    @NacosInjected
    private NamingService namingService;

    @Value("${server.port}")
    private int serverPort;
    
    @Value("${spring.application.name}")
    private String applicationName;
    
    public static void main(String[] args) {
        SpringApplication.run(BootBaseApplication.class, args);
    }

/*    @PostConstruct
    public void registerInstance() throws NacosException {
        namingService.registerInstance(applicationName,"test-group","127.0.0.1",serverPort);
    }*/
}
